import { COOK_IMAGEURL } from 'assets/js/const'

export default {
  convertMenusTypes(datas){
    var result = []
    datas.forEach(function(element, index, arrs){
      result.push({
        id: element.id,
        name: element.name
      })
    })
    return result
  },
  convertMenusList(datas){
    var result = []
    datas.forEach(function(element, index, arrs){
      result.push({
        id: element.id,
        name: element.name,
        food: element.food,
        imageUrl: `${COOK_IMAGEURL}${element.img}`
      })
    })
    return result
  },
  convertMenusInfo(element){
    var result = {}
    Object.assign(result, {
      id: element.id,
      name: element.name,
      food: element.food,
      imageUrl: `${COOK_IMAGEURL}${element.img}`,
      message: element.message,
      description: element.description
    })
    return result
  }
}
